package org.hwadee.entity;

import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class Message {
    /* 数据库中用自增主键实现即可 */
    private Integer messageId;
    /* 消息内容 */
    private String messageContent;
    /*消息发送者*/
    private Integer sender;
    /*消息接收者*/
    private Integer receiver;
    /*消息发送时间 */
    private Date sendTime;
    /* 是否有新消息 */
    private boolean isNew;

    public Message() {

    }

    public Message(String content, Integer sender, Integer receiver, Date sendTime, boolean isNew) {
        this.messageContent = content;
        this.sender = sender;
        this.receiver = receiver;
        this.sendTime = sendTime;
        this.isNew = isNew;
    }

    public Integer getMessageId() {
        return messageId;
    }

    public void setMessageId(Integer messageId) {
        this.messageId = messageId;
    }

    public String getMessageContent() {
        return messageContent;
    }

    public void setMessageContent(String messageContent) {
        this.messageContent = messageContent;
    }

    public Integer getSender() {
        return sender;
    }

    public void setSender(Integer sender) {
        this.sender = sender;
    }

    public Integer getReceiver() {
        return receiver;
    }

    public void setReceiver(Integer receiver) {
        this.receiver = receiver;
    }

    public Date getSendTime() {
        return sendTime;
    }

    public void setSendTime(Date sendTime) {
        this.sendTime = sendTime;
    }

    public boolean isNew() {
        return isNew;
    }

    public void setNew(boolean aNew) {
        isNew = aNew;
    }

    @Override
    public String toString() {
        return "Message{" +
                "id=" + messageId +
                ", content='" + messageContent + '\'' +
                ", sender='" + sender + '\'' +
                ", receiver='" + receiver + '\'' +
                ", sendTime=" + sendTime +
                ", isNew=" + isNew +
                '}';
    }
}
